import java.util.*;

public class HallManager {
    private List<Hall> halls = new ArrayList<>();

    public void initDefaultHalls() {
        halls.add(new Hall("黄金厅", 8, 10));
        halls.add(new Hall("白银厅", 10, 12));
        halls.add(new Hall("翡翠厅", 7, 8));
        halls.add(new Hall("钻石厅", 7, 8));
        halls.add(new Hall("宝石厅", 8, 9));
    }

    public List<Hall> getHalls() {
        return halls;
    }

    public Hall findHallByName(String name) {
        for (Hall h : halls) {
            if (h.getName().equals(name)) {
                return h;
            }
        }
        return null;
    }

    public boolean addHall(Hall hall) {
        if (findHallByName(hall.getName()) != null) return false;
        halls.add(hall);
        return true;
    }

    public boolean removeHall(String name) {
        Iterator<Hall> it = halls.iterator();
        while (it.hasNext()) {
            if (it.next().getName().equals(name)) {
                it.remove();
                return true;
            }
        }
        return false;
    }
} 